#!/usr/bin/env python
# -*- coding: utf-8 -*-
#   
#       Copyright 2010 Santiago Lezica, Juan Pablo Orsay, Facundo Martinez.
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

from model import Message

# A message needs to specify a type_id, and either from_id or to_id, depending
# on whether it's a Request or Response/Notification. Other variables may also
# be specified in the class definition, and they will be sent with
# the message too (values here will be used if not set in instance).
# This also means NO ATTRIBUTE of a message instance is sent or read if not
# specified as a class variable.

# The current convention for Message Type IDs is:
#   a length 4 string in capital letters, formed by concatenating:
#       - a 3-letter combination describing the message.
#       - a single chr 'R' for Request, 'P' for response, 'N' for notification.

# For example:
class EchoRequest(Message):
    type_id = "ECHR"
    text = ""
    
class EchoResponse(Message):
    type_id = "ECHP"
    text = ""

class EchoNotification(Message):
    type_id = "ECHN" # kind of ridiculous, an echo notification, but oh well.
